# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fstealer
pkgver=0.1
pkgrel=7
groups=('blackarch' 'blackarch-automation' 'blackarch-misc')
pkgdesc='Automates file system mirroring through remote file disclosure vulnerabilities on Linux machines.'
arch=('any')
url='http://packetstormsecurity.com/files/106450/FStealer-Filesystem-Mirroring-Tool.html'
license=('custom:unknown')
depends=('python2' 'python2-simplejson')
source=('https://dl.packetstormsecurity.net/UNIX/utilities/fstealer.tar.gz')
sha512sums=('4f4a00b7c68a91ab208d2ba3b01c0e3e9c7f0fc1563cba17774f0b28ccca454766e725a3f3b95d38f7c59aeabbde070eefe9baa6edd1dcb8f34fa9798992098c')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" BUGS README TODO

  rm BUGS README TODO

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

